<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/common/taglibs.jsp" %>
<!DOCTYPE HTML>
<html>
<%@ include file="/WEB-INF/common/header.jsp" %>
<body>
	<nav class="Hui-breadcrumb">
		<i class="icon-home"></i> 首页
		<span class="c-gray en">&gt;</span> 配置中心
		<span class="c-gray en">&gt;</span> 配置管理
		<a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" >
			<i class="icon-refresh"></i>
		</a>
	</nav>
	<div class="pd-20">
		<div class="text-c"> 日期范围：
			<input type="text" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'datemax\')||\'%y-%M-%d\'}'})" id="datemin" class="input-text Wdate" style="width:120px;">
			-
			<input type="text" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'datemin\')}',maxDate:'%y-%M-%d'})" id="datemax" class="input-text Wdate" style="width:120px;">
			<input type="text" class="input-text" style="width:250px" placeholder="输入会员名称、电话、邮箱" id="" name=""><button type="submit" class="btn btn-success" id="" name=""><i class="icon-search"></i> 搜用户</button>

		</div>
		<div class="cl pd-5 bg-1 bk-gray mt-20">
			<span class="r"><a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="icon-trash"></i> 批量删除</a>
			<a href="javascript:;" onclick="cleanSystem()" class="btn btn-primary radius r"><i class="icon-plus"></i> 清理缓存</a></span>
		</div>
		<table class="table table-border table-bordered table-hover table-bg table-sort" id="table_cl">

		</table>
		<div id="pageNav" class="pageNav"></div>
	</div>

<script type="text/javascript">
	var requestRoot = '${requestroot}';
	$(function(){
		var table = YueXiang.Page.getList(requestRoot+"/config/message/list",
				[{
					"name" : "id",
					"title" : "编号"
				},{
					"name" : "nid",
					"title" : "名称"
				},{
					"name" : "value",
					"title" : "值"
				},{
					"name":"",
					"title":'<input type="checkbox" name="" value="">'
				}],
				'table_cl',
				function(aoData){
					aoData.push( { "name": "searchName", "value": $("#searchName").val() } );
				},
				function(nRow, aData, iDisplayIndex) {
					var html = '<input type="checkbox" name="id" value="'+aData.id+'">';
					html += '<a href="javascript:;" onclick="edit('+aData.id+')" class="btn btn-primary radius r"><i class="icon-plus"></i> 编辑</a>';
					$('td:eq(3)', nRow).html(html);
				});
	});

	function edit(id){
		ClMainJs.Popup.layer_show('550','','编辑',requestRoot+'/config/message/edit?id='+id);
	}

	function cleanSystem(){
		$.ajax({
			type: "get",
			url: requestRoot + '/config/message/clean',
			headers: {
				accept: "application/json; charset=utf-8"
			},
			dataType: "json",
			success: function (result) {
				var status = result.status;
				if(status=="200"){
					alert("清理成功");
				}else{
					alert("清理失败");
				}
			}
		});
	}
</script>
</body>
</html>